/*
 * @Author       : Hejh(3010733382@qq.com)
 * @Version      : V1.0
 * @Date         : 2024-01-30 16:35:15
 * @Description  : 部门内用户的相关操作接口
 */
import type {
  SetSizeMaxUserDepReq,
  UserDepCopyReq,
  UserDepMoveReq
} from '@/types/userDep'
import type { UserCreateReq, UserUpdateReq } from '@/types/user'
import request from '@/utils/request'

// 添加部门内用户接口
export const createUserDep = (data: UserCreateReq) => {
  return request.post('/userDep/create', data)
}

// 更新部门内用户接口
export const updateUserDep = (data: UserUpdateReq) => {
  return request.post('/userDep/update', data)
}

// 成员的部门迁移接口
export const moveUserDep = (data: UserDepMoveReq) => {
  return request.put('/userDep/move', data)
}

// 添加用户到部门接口
export const copyUserDep = (data: UserDepCopyReq) => {
  return request.post('/userDep/copy', data)
}

// 将用户从部门移除接口
export const removeUserDep = (userDepIds: string[]) => {
  return request.delete('/userDep/delete', { data: { userDepIds } })
}

// 批量设置部门内成员接口
export const SetSizeMaxUserDep = (data: SetSizeMaxUserDepReq) => {
  return request.put('/userDep/setSizeMax', data)
}
